<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once APPPATH2 . 'libraries/MY_Front_Controller.php';
require_once APPPATH2 . 'libraries/Captcha.php';

/**
 * 
 * 
 * Enter description here ...
 * @author Administrator
 *
 */
class Captcha1 extends MY_Front_Controller 
{
    public function random($size='size',$size_value='20')
    {//ob_end_clean();
        
//        //$this->log4php->debug(1111);
        Captcha::$useImgBg = false;  // 是否使用背景图片
        Captcha::$useNoise = false; // 是否添加杂点 
        Captcha::$useCurve = false; // 是否绘制干扰线 
        Captcha::$useZh    = false; // 是否使用中文验证码 
        Captcha::$fontSize = $size_value;   // 验证码字体大小(像素) 
        Captcha::$length   = 4;    // 验证码字符数
        Captcha::entry();  // 输出图片

//        $path = APPPATH2 .'libraries/Captcha/bgs/1.jpg';
//        $img = imagecreatefromjpeg($path);
//      header("Content-type: image/jpeg");
//        imagejpeg($img);

//       header("Content-type: image/png");
//$im = @imagecreate(100, 50)
//    or die("Cannot Initialize new GD image stream");
//$background_color = imagecolorallocate($im, 255, 255, 255);
//$text_color = imagecolorallocate($im, 233, 14, 91);
//imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);
//imagepng($im);
//imagedestroy($im);
        
        
    }
	
}

